package com.zbkj.common.enums;

import com.google.common.collect.Lists;
import lombok.Getter;

import java.util.List;

/**
 * @Auther:
 * @Date: 2024/7/10 21:46
 * @Description: 报告申请状态：0未申请,1申请中,2已驳回,3已通过
 */
public enum ReportApplyStatusEnum {

    /**
     * 未申请
     */
    UN_APPLY(0),
    /**
     * 申请中
     */
    IN_APPLY(1),

    /**
     * 已驳回
     */
    REJECT_APPLY(2),

    /**
     * 已通过
     */
    PASS_APPLY(3);

    @Getter
    private int status;

    ReportApplyStatusEnum(int status) {
        this.status = status;
    }

    public static boolean isUnStatus(Integer status) {
        return status != null && UN_APPLY.status == status;
    }

    public static boolean isInStatus(Integer status) {
        return status != null && IN_APPLY.status == status;
    }

    public static boolean isRejectStatus(Integer status) {
        return status != null && REJECT_APPLY.status == status;
    }

    public static boolean isPassStatus(Integer status) {
        return status != null && PASS_APPLY.status == status;
    }

    /**
     * 可进行申请报告 状态检查
     * @param status
     * @return
     */
    public static boolean applyStatusCheck(Integer status) {
        return status != null && (UN_APPLY.getStatus() == status
                || REJECT_APPLY.getStatus() == status);
    }

    /**
     * 申请报告更新-检查状态集合
     * @return
     */
    public static List applyCheckStatusList() {
        return Lists.newArrayList(UN_APPLY.getStatus(),REJECT_APPLY.getStatus());
    }

}
